Package-level declarations

Types

Link copied to clipboard
@Serializable
data class Birthdate(val day: Int, val month: Int, val year: Int? = null)
Link copied to clipboard
@Serializable
data class CallbackQuery(val id: String, val from: User, val message: MaybeInaccessibleMessage? = null, val inlineMessageId: String? = null, val chatInstance: String, val data: String? = null, val gameShortName: String? = null)

This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.

Link copied to clipboard
@Serializable
data class Contact(val phoneNumber: String, val firstName: String, val lastName: String? = null, val userId: Long? = null, val vcard: String? = null)

This object represents a phone contact.

Link copied to clipboard
@Serializable
data class ContactContent(val phoneNumber: String, val firstName: String, val lastName: String? = null, val userId: Long? = null, val vcard: String? = null) : InputMessageContent
Link copied to clipboard
@Serializable
enum EmojiType : Enum<EmojiType>
Link copied to clipboard
@Serializable
enum EntityType : Enum<EntityType>
Link copied to clipboard
@Serializable
data class ExternalReplyInfo(val origin: MessageOrigin, val chat: Chat? = null, val messageId: Long? = null, val linkPreviewOptions: LinkPreviewOptions? = null, val animation: Animation? = null, val audio: Audio? = null, val document: Document? = null, val photo: List<PhotoSize>? = null, val sticker: Sticker? = null, val story: Story? = null, val video: Video? = null, val videoNote: VideoNote? = null, val voice: Voice? = null, val hasMediaSpoiler: Boolean? = null, val contact: Contact? = null, val dice: Dice? = null, val game: Game? = null, val giveaway: Giveaway? = null, val giveawayWinners: GiveawayWinners? = null, val invoice: Invoice? = null, val location: Location? = null, val poll: Poll? = null, val venue: Venue? = null)

This object contains information about a message that is being replied to, which may come from another chat or forum topic.

Link copied to clipboard
@Serializable
data class Giveaway(val chats: List<Chat>, val winnersSelectionDate: Long, val winnerCount: Int, val onlyNewMembers: Boolean? = null, val hasPublicWinners: Boolean? = null, val prizeDescription: String? = null, val countryCodes: List<String>? = null, val premiumSubscriptionMonthCount: Int? = null)

This object represents a message about a scheduled giveaway.

Link copied to clipboard
@Serializable
data class GiveawayCompleted(val winnerCount: Int, val unclaimedPrizeCount: Int? = null, val giveawayMessage: Message? = null)

This object represents a service message about the completion of a giveaway without public winners.

Link copied to clipboard
@Serializable
data object GiveawayCreated
Link copied to clipboard
@Serializable
data class GiveawayWinners(val chat: Chat, val giveawayMessageId: Long, val winnersSelectionDate: Long, val winnerCount: Int, val winners: List<User>, val additionalChatCount: Int? = null, val premiumSubscriptionMonthCount: Int? = null, val unclaimedPrizeCount: Int? = null, val onlyNewMembers: Boolean? = null, val wasRefunded: Boolean? = null, val prizeDescription: String? = null)

This object represents a message about the completion of a giveaway with public winners.

Link copied to clipboard
@Serializable
sealed class InputMessageContent
Link copied to clipboard
@Serializable
data class InvoiceContent(val title: String, val description: String, val payload: String, val providerToken: String, val currency: Currency, val prices: List<LabeledPrice>, val maxTipAmount: Int? = null, val suggestedTipAmounts: List<Int>? = null, val providerData: String? = null, val photoUrl: String? = null, val photoSize: Int? = null, val photoWidth: Int? = null, val photoHeight: Int? = null, val needName: Boolean? = null, val needPhoneNumber: Boolean? = null, val needEmail: Boolean? = null, val needShippingAddress: Boolean? = null, val sendPhoneNumberToProvider: Boolean? = null, val sendEmailToProvider: Boolean? = null, val isFlexible: Boolean? = null) : InputMessageContent
Link copied to clipboard
@Serializable
data class LinkPreviewOptions(var isDisabled: Boolean? = null, var url: String? = null, var preferSmallMedia: Boolean? = null, var preferLargeMedia: Boolean? = null, var showAboveText: Boolean? = null)

Describes the options used for link preview generation.

Link copied to clipboard
@Serializable
data class Location(val longitude: Float, val latitude: Float, val horizontalAccuracy: Float? = null, val livePeriod: Int? = null, val heading: Int? = null, val proximityAlertRadius: Int? = null)

This object represents a point on the map.

Link copied to clipboard
@Serializable
data class LocationContent(val latitude: Float, val longitude: Float, val horizontalAccuracy: Float? = null, val livePeriod: Int? = null, val heading: Int? = null, val proximityAlertRadius: Int? = null) : InputMessageContent
Link copied to clipboard
@Serializable(with = MaybeInaccessibleMessage.Companion::class)
sealed class MaybeInaccessibleMessage

This object describes a message that can be inaccessible to the bot. It can be one of

Link copied to clipboard
@Serializable
data class Message(val messageId: Long, val messageThreadId: Int? = null, val from: User? = null, val senderChat: Chat? = null, val senderBoostCount: Int? = null, val senderBusinessBot: User? = null, val date: Instant, val businessConnectionId: String? = null, val chat: Chat, val forwardOrigin: MessageOrigin? = null, val isTopicMessage: Boolean? = null, val isAutomaticForward: Boolean? = null, val replyToMessage: Message? = null, val externalReply: ExternalReplyInfo? = null, val replyToStory: Story? = null, val quote: TextQuote? = null, val viaBot: User? = null, val editDate: Instant? = null, val hasProtectedContent: Boolean? = null, val isFromOffline: Boolean? = null, val mediaGroupId: String? = null, val authorSignature: String? = null, val text: String? = null, val entities: List<MessageEntity>? = null, val linkPreviewOptions: LinkPreviewOptions? = null, val animation: Animation? = null, val audio: Audio? = null, val document: Document? = null, val photo: List<PhotoSize>? = null, val sticker: Sticker? = null, val story: Story? = null, val video: Video? = null, val videoNote: VideoNote? = null, val voice: Voice? = null, val caption: String? = null, val captionEntities: List<MessageEntity>? = null, val contact: Contact? = null, val dice: Dice? = null, val game: Game? = null, val poll: Poll? = null, val venue: Venue? = null, val location: Location? = null, val newChatMembers: List<User>? = null, val leftChatMember: User? = null, val newChatTitle: String? = null, val newChatPhoto: List<PhotoSize>? = null, val deleteChatPhoto: Boolean? = null, val groupChatCreated: Boolean? = null, val supergroupChatCreated: Boolean? = null, val channelChatCreated: Boolean? = null, val messageAutoDeleteTimerChanged: MessageAutoDeleteTimerChanged? = null, val migrateToChatId: Long? = null, val migrateFromChatId: Long? = null, val pinnedMessage: MaybeInaccessibleMessage? = null, val invoice: Invoice? = null, val successfulPayment: SuccessfulPayment? = null, val usersShared: UsersShared? = null, val chatShared: ChatShared? = null, val connectedWebsite: String? = null, val writeAccessAllowed: WriteAccessAllowed? = null, val passportData: PassportData? = null, val proximityAlertTriggered: ProximityAlertTriggered? = null, val boostAdded: ChatBoostAdded? = null, val forumTopicCreated: ForumTopicCreated? = null, val forumTopicEdited: ForumTopicEdited? = null, val forumTopicClosed: ForumTopicClosed? = null, val forumTopicReopened: ForumTopicReopened? = null, val generalForumTopicHidden: GeneralForumTopicHidden? = null, val generalForumTopicUnhidden: GeneralForumTopicUnhidden? = null, val giveawayCreated: GiveawayCreated? = null, val giveaway: Giveaway? = null, val giveawayWinners: GiveawayWinners? = null, val giveawayCompleted: GiveawayCompleted? = null, val videoChatScheduled: VideoChatScheduled? = null, val videoChatStarted: VideoChatStarted? = null, val videoChatEnded: VideoChatEnded? = null, val videoChatParticipantsInvited: VideoChatParticipantsInvited? = null, val webAppData: WebAppData? = null, val replyMarkup: InlineKeyboardMarkup? = null, val hasMediaSpoiler: Boolean? = null) : MaybeInaccessibleMessage, MultipleResponse

This object represents a message.

Link copied to clipboard
@Serializable
data class MessageAutoDeleteTimerChanged(val messageAutoDeleteTime: Int)

This object represents a service message about a change in auto-delete timer settings.

Link copied to clipboard
@Serializable
data class MessageEntity(val type: EntityType, val offset: Int, val length: Int, val url: String? = null, val user: User? = null, val language: String? = null, val customEmojiId: String? = null)

This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

Link copied to clipboard
@Serializable
data class MessageId(val messageId: Long) : MultipleResponse

This object represents a unique message identifier.

Link copied to clipboard
@Serializable
sealed class MessageOrigin

This object describes the origin of a message. It can be one of

Link copied to clipboard
@Serializable
data class MessageReactionCountUpdated(val chat: Chat, val messageId: Long, val date: Instant, val reactions: List<ReactionCount>)

This object represents reaction changes on a message with anonymous reactions.

Link copied to clipboard
@Serializable
data class MessageReactionUpdated(val chat: Chat, val messageId: Long, val user: User? = null, val actorChat: Chat? = null, val date: Instant, val oldReaction: List<ReactionType>, val newReaction: List<ReactionType>)

This object represents a change of a reaction on a message performed by a user.

Link copied to clipboard
@Serializable
enum ParseMode : Enum<ParseMode>
Link copied to clipboard
@Serializable
data class Poll(val id: String, val question: String, val options: List<PollOption>, val totalVoterCount: Int, val isClosed: Boolean, val isAnonymous: Boolean, val type: PollType, val allowsMultipleAnswers: Boolean, val correctOptionId: Int? = null, val explanation: String? = null, val explanationEntities: List<MessageEntity>? = null, val openPeriod: Int? = null, val closeDate: Instant? = null)

This object contains information about a poll.

Link copied to clipboard
@Serializable
data class PollAnswer(val pollId: String, val voterChat: Chat? = null, val user: User, val optionIds: List<Int>)

This object represents an answer of a user in a non-anonymous poll.

Link copied to clipboard
@Serializable
data class PollOption(val text: String, val voterCount: Int)

This object contains information about one answer option in a poll.

Link copied to clipboard
@Serializable
enum PollType : Enum<PollType>
Link copied to clipboard
@Serializable
data class ProximityAlertTriggered(val traveler: User, val watcher: User, val distance: Int)

This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.

Link copied to clipboard
@Serializable
data class ReactionCount(val type: ReactionType, val totalCount: Int)

Represents a reaction added to a message along with the number of times it was added.

Link copied to clipboard
@Serializable
sealed class ReactionType

This object describes the type of a reaction. Currently, it can be one of

Link copied to clipboard
@Serializable
data class ReplyParameters(var messageId: Long, var chatId: Identifier? = null, var allowSendingWithoutReply: Boolean? = null, var quote: String? = null, var quoteParseMode: String? = null, var quoteEntities: List<MessageEntity>? = null, var quotePosition: Int? = null)

Describes reply parameters for the message that is being sent.

Link copied to clipboard
@Serializable
data class ResponseParameters(val migrateToChatId: Long? = null, val retryAfter: Int? = null)

Describes why a request was unsuccessful.

Link copied to clipboard
@Serializable
data class SentWebAppMessage(val inlineMessageId: String? = null)

Describes an inline message sent by a Web App on behalf of a user.

Link copied to clipboard
@Serializable
data class SharedUser(val userId: Long, val firstName: String? = null, val lastName: String? = null, val username: String? = null, val photo: List<PhotoSize>? = null)

This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUser button.

Link copied to clipboard
@Serializable
data class Text(val messageText: String, val parseMode: ParseMode? = null, val entities: List<MessageEntity>? = null, val linkPreviewOptions: LinkPreviewOptions? = null) : InputMessageContent
Link copied to clipboard
@Serializable
data class TextQuote(val text: String, val entities: List<MessageEntity>? = null, val position: Int, val isManual: Boolean? = null)

This object contains information about the quoted part of a message that is replied to by the given message.

Link copied to clipboard
@Serializable
data class Update(val updateId: Int, val message: Message? = null, val editedMessage: Message? = null, val channelPost: Message? = null, val editedChannelPost: Message? = null, val businessConnection: BusinessConnection? = null, val businessMessage: Message? = null, val editedBusinessMessage: Message? = null, val deletedBusinessMessages: BusinessMessagesDeleted? = null, val messageReaction: MessageReactionUpdated? = null, val messageReactionCount: MessageReactionCountUpdated? = null, val inlineQuery: InlineQuery? = null, val chosenInlineResult: ChosenInlineResult? = null, val callbackQuery: CallbackQuery? = null, val shippingQuery: ShippingQuery? = null, val preCheckoutQuery: PreCheckoutQuery? = null, val poll: Poll? = null, val pollAnswer: PollAnswer? = null, val myChatMember: ChatMemberUpdated? = null, val chatMember: ChatMemberUpdated? = null, val chatJoinRequest: ChatJoinRequest? = null, val chatBoost: ChatBoostUpdated? = null, val removedChatBoost: ChatBoostRemoved? = null) : MultipleResponse

This object represents an incoming update. At most one of the optional parameters can be present in any given update.

Link copied to clipboard
@Serializable
data class User(val id: Long, val isBot: Boolean, val firstName: String, val lastName: String? = null, val username: String? = null, val languageCode: String? = null, val isPremium: Boolean? = null, val addedToAttachmentMenu: Boolean? = null, val canJoinGroups: Boolean? = null, val canReadAllGroupMessages: Boolean? = null, val supportsInlineQueries: Boolean? = null, val canConnectToBusiness: Boolean? = null)

This object represents a Telegram user or bot.

Link copied to clipboard
@Serializable
data class UserProfilePhotos(val totalCount: Int, val photos: List<List<PhotoSize>>)

This object represent a user's profile pictures.

Link copied to clipboard
@Serializable
data class UsersShared(val requestId: Int, val users: List<SharedUser>)

This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.

Link copied to clipboard
@Serializable
data class Venue(val location: LocationContent, val title: String, val address: String, val foursquareId: String? = null, val fourSquareType: String? = null, val googlePlaceId: String? = null, val googlePlaceType: String? = null)

This object represents a venue.

Link copied to clipboard
@Serializable
data class VenueContent(val latitude: Float, val longitude: Float, val title: String, val address: String, val foursquareId: String? = null, val fourSquareType: String? = null, val googlePlaceId: String? = null, val googlePlaceType: String? = null) : InputMessageContent
Link copied to clipboard
@Serializable
data class WebhookInfo(val url: String, val hasCustomCertificate: Boolean, val pendingUpdateCount: Int, val ipAddress: String? = null, val lastErrorDate: Instant? = null, val lastErrorMessage: String? = null, val lastSynchronizationErrorDate: Instant? = null, val maxConnections: Int? = null, val allowedUpdates: List<UpdateType>? = null)

Describes the current status of a webhook.

Link copied to clipboard
@Serializable
data class WriteAccessAllowed(val fromRequest: Boolean? = null, val fromAttachmentMenu: Boolean? = null, val webAppName: String? = null)

This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.